closestBed -a data/H1hescEgr1_c1.bed -b data/knownGene.bed -d |awk 'BEGIN {OFS="\t"} {if ($NF==0&&$10=="+"&&($2+$3)/2<$6) print $1,$2,$3}' |windowBed -a stdin -b ~/DNase/data/wgEncodeAwgTfbsHaibH1hescPol24h8V0416102UniPk.narrowPeak -w 0|awk '{mid=($2+$3)/2;print ($5+$6)/2-mid}'|sort -g >temp
closestBed -a data/H1hescEgr1_c2.bed -b data/knownGene.bed -d |awk 'BEGIN {OFS="\t"} {if ($NF==0&&$10=="-"&&($2+$3)/2>$7) print $1,$2,$3}' |windowBed -a stdin -b ~/DNase/data/wgEncodeAwgTfbsHaibH1hescPol24h8V0416102UniPk.narrowPeak -w 0|awk '{mid=($2+$3)/2;print ($5+$6)/2-mid}'|sort -g >temp
